package com.xq.ex.commom.err;


import com.xq.ex.commom.result.R;
import com.xq.ex.commom.result.ResultCodeEnum;

/**
 * @author 飞哥
 * @Title: 学相伴出品
 * @Description: 我们有一个学习网站：https://www.kuangstudy.com
 * @date 2021/6/2 10:40
 */
public class ValidationException extends RuntimeException {
    private Integer code;
    private String message;
    public ValidationException(ResultCodeEnum resultCodeEnum) {
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
    }

    public ValidationException(R r) {
        this.code = r.getCode();
        this.message = r.getMessage();
    }

    public ValidationException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}